#ifndef STRUCTEDGES_HPP
#define STRUCTEDGES_HPP

// #include "meshTypes_fwd.hpp"
// #include <experimental/memory>
#include "structEdgesBase.hpp"

namespace hms {

template<>
class EdgesTraits<StructEdges>
{
public:
	using MeshType = StructMesh;
	using NormalsReturnType = const Matrix2Xs&;
	using LengthsReturnType = const ArrayXs&;
};


class StructEdges : public StructEdgesBase<StructEdges>
{
private:
	ArrayXs m_lengths;
	Matrix2Xs m_normals;

public:
	auto length(Index) const -> scalar;
	auto normal(Index) const -> Matrix2Xs::ConstColXpr;

private:
	StructEdges() = default;
	StructEdges( const StructMesh& );

	auto lengthsImp() const -> LengthsReturnType;
	auto normalsImp() const -> NormalsReturnType;

	void storeData();

	void storeLengths();
	void storeNormals();

	friend StructEdge;
	friend StructMesh;
	friend EdgesBase;
	friend MeshBase<StructMesh>;
};


}


#endif